package com.ccrfid.rmc6.service.alarm;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.alarm.AlarmNotifyRecordView;
import com.ccrfid.rmc6.entity.alarm.AlarmRecordEntity;
import com.ccrfid.rmc6.pojo.dto.alarm.AlarmNotifyRecordCountDto;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface AlarmRecordService {
    //
    Page<AlarmRecordEntity> getAlarmRecords(SearchCriteria criteria, Pageable pageable);

    Page<AlarmNotifyRecordView> getPersonalAlarmNotifyRecords(SearchCriteria criteria, Pageable pageable);

    AlarmRecordEntity getAlarmCallRecordInMinute(Long cardNumber, Long time);
    //
    AlarmRecordEntity getAlarmCutoffRecordUnClosed(Long cardNumber);
    //
    AlarmRecordEntity getAlarmLowpowerRecordUnClosed(Long cardNumber);
    //
    AlarmRecordEntity getAlarmOfflineRecordUnClosed(Long cardNumber);
    //
    AlarmRecordEntity createAlarmRecord(AlarmRecordEntity entity);
    //
    AlarmRecordEntity updateAlarmRecord(AlarmRecordEntity entity);

    //标记某条告警已读
    Boolean markReadPersonalAlarmRecord(Long alarmNotifyRecordId) throws AppException;

    //批量标记已读
    Boolean markReadPersonalAlarmRecords(List<Long> idList) throws AppException;

    //全部标记已读
    Boolean markReadAllPersonalAlarmRecords(String userAccount);

    //获取告警信息数量
    AlarmNotifyRecordCountDto getAlarmNotifyRecordCount(Long notifyPersonnelId);

    Integer getViolation(Long noyifyPersonnelId, List<Integer> alarmTypeList, Integer read);

    /**
     * 获得对应类型未解除得生命体征预警记录
     * @param cardNumber
     * @return
     */
    AlarmRecordEntity getAlarmVitalSignRecordUnClosed(Long cardNumber,Integer alarmType);
}
